package io.renren.service.impl;

import io.renren.dao.BaseDao;
import io.renren.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/4/27 0027.
 */
public class BaseServiceImpl<T> implements BaseService<T> {
    @Autowired
    private BaseDao<T> baseDao;

    @Override
    public int queryTotal(Map<String, Object> map) {
        return baseDao.queryTotal(map);
    }

    @Override
    public List<T> queryList(Map<String, Object> map) {
        return baseDao.queryList(map);
    }

    @Override
    public void insert(T t) {
        baseDao.insert(t);
    }

    @Override
    public void update(T t) {
        baseDao.update(t);
    }

    @Override
    public T selectOne(Long id) {
        return baseDao.selectOne(id);
    }

    @Override
    public void delete(Long id) {
        baseDao.delete(id);
    }

    @Override
    @Transactional
    public void deleteBatch(Long[] menuIds) {
        baseDao.deleteBatch(menuIds);
    }
}
